package com.tiancheng.trade.merchant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: kellen
 * @Description: 商户类型枚举
 * @Date: create in 2024/11/19 16:17
 */
@Getter
@AllArgsConstructor
public enum MerchantTypeEnums {
    qi_ye(1,"企业商户","00"),
    ge_ren(2,"个人工商户","01"),
    xiao_wei(3,"小微商户","02"),
    ji_guan(4,"机关事业单位或社会团体","03");
//    min_bab("05","民办非企业");

    private final Integer code;
    private final String name;
    private final String outCode;

    public static Optional<MerchantTypeEnums> getByCode(Integer code){
        return Arrays.stream(MerchantTypeEnums.values()).filter(m->m.getCode().equals(code)).findFirst();
    };
}
